/**
 * @description:  获取search配置信息
 * @return {Array<CommonSearch.SearchOption>}
 */
export const useSearchOption = (): Array<CommonSearch.SearchOption> => {
  const wasteType: CommonSearch.SearchOption = {
    label: "废弃物类别",
    key: "wasteType",
    value: null,
    type: "select",
    option: [
      {
        label: "C级防护服",
        value: "C_CLOTHES"
      },
      {
        label: "D级防护服",
        value: "D_CLOTHES"
      },
      {
        label: "废液桶",
        value: "WASTE_TANK"
      },
      {
        label: "空桶",
        value: "NULL_TANK"
      },
      {
        label: "手套",
        value: "GLOVE"
      },
      {
        label: "吸酸棉",
        value: "ACID_ABSORBING_COTTON"
      },
      {
        label: "纸带",
        value: "PAPER_TAPE"
      }
    ],
    placeholder: "请选择废弃物类别",
    span: 5
  };

  const dangerousNature: CommonSearch.SearchOption = {
    label: "	危险特性",
    key: "dangerousNature",
    value: null,
    type: "select",
    option: [
      {
        label: "酸性",
        value: "ACIDITY"
      },
      {
        label: "碱性",
        value: "ALKALINE"
      },
      {
        label: "易燃",
        value: "COMBUSTIBLE"
      }
    ],
    placeholder: "请选择危险特性",
    span: 5
  };

  const startDate: CommonSearch.SearchOption = {
    label: "产生日期",
    key: "startDate",
    realKeys: ["startDate", "endDate"],
    value: [],
    type: "daterange",
    span: 5
  };

  return [wasteType, dangerousNature, startDate];
};

/**
 * @description:  获取table表格的表头（cloumns）信息
 * @return {Array<CommonTable.TableCloumnsType>}
 */
export const useTableCloumns = (): Array<CommonTable.TableCloumnsType> => {
  const produceConditionChildren: Array<CommonTable.TableCloumnsType> = [
    {
      label: "废弃物类别",
      prop: "wasteTypeDesc"
    },
    {
      label: "危险特性",
      prop: "dangerousNatureDesc"
    },
    {
      label: "产废环节",
      prop: "wasteProductionProcess"
    },
    {
      label: "产生日期",
      prop: "productionDay"
    },
    {
      label: "产生时间",
      prop: "productionTime"
    },
    {
      label: "废物数量",
      prop: "wasteNum"
    },
    {
      label: "盛废材料及容积",
      prop: "wasteMaterialVolume"
    },
    {
      label: "废物重量（KG）",
      prop: "wasteWeight"
    }
  ];
  const transferConditionChildren: Array<CommonTable.TableCloumnsType> = [
    {
      label: "转移日期",
      prop: "transferDay"
    },
    {
      label: "转移时间",
      prop: "transferTime"
    },
    {
      label: "废物去向",
      prop: "wasteDestination"
    },
    {
      label: "产废部门签字",
      prop: "productionDepartmentSign"
    },
    {
      label: "转运部门签字",
      prop: "transferDepartmentSign"
    }
  ];

  const produceCondition: CommonTable.TableCloumnsType = {
    prop: "produceCondition",
    label: "产生情况",
    props: {
      headerAlign: "center"
    },
    children: produceConditionChildren
  };

  const transferCondition: CommonTable.TableCloumnsType = {
    prop: "produceCondition",
    label: "转移情况",
    props: {
      headerAlign: "center"
    },
    children: transferConditionChildren
  };

  const cloumns = [produceCondition, transferCondition];
  return cloumns;
};
